<?php 
$cs=Yii::app()->clientScript;
$cs->registerCssFile(Yii::app()->baseUrl.'/css/form.css');
?>
<div class="yiiForm">
<?php
	echo EHtml::form();	
	EHtml::setOptions(array('errorElement'=> 'span',));		
	EHtml::setScenario($update?'':'create');
?>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'series_name'); ?>
<?php echo CHtml::activeTextField($model,'series_name',array('size'=>20,'maxlength'=>20)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'name'); ?>
<?php echo CHtml::activeTextField($model,'name',array('size'=>20,'maxlength'=>20)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'type'); ?>
<?php echo CHtml::activeTextField($model,'type',array('size'=>50,'maxlength'=>50)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'standards'); ?>
<?php echo CHtml::activeTextField($model,'standards',array('size'=>50,'maxlength'=>50)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'material'); ?>
<?php echo CHtml::activeTextField($model,'material',array('size'=>50,'maxlength'=>50)); ?>
</div>
<div class="simple4">
<?php echo CHtml::activeLabelEx($model,'logo'); ?>(容量小于200K)
<img id="logo_img" src='<?php echo $model->logo==''?'images/no_photo.gif':$model->logo;?>' width="170" height="90"/>
<?php
$this->widget('application.extensions.xheditor.JXHEditor', array(
      'model' => $model,
      'attribute' => 'logo',
      'options' => array(
          'width' => '30',
          'height' => '15',
		  'upImgUrl' =>'?r=product/uploadedFiles&mode=product_logo',//logo形式 会把下面logo(img)写入src ve防止用tab写入临时变量
		  'upImgExt' =>'jpg,jpeg,gif,png',
		  'tools' => 'Img',
		  'img_sum' => 1,//最多一张图片
		  'logo' => '#logo_img',
		  've' => '#logo1'	
      ),
      'htmlOptions' => array('readonly'=>'readonly')
  ));
?>
<input id="logo1" type="hidden" name="Product[logo1]" value="<?php echo $model->logo?>"/>
<?php //echo CHtml::button('删除图片',array('onclick'=>"$('#logo_img').attr('src','images/no_photo.gif');$('#Business_logo').val('');$('#logo1').val('');"));?>
</div>
<div class="simple4">
<?php echo CHtml::activeLabelEx($model,'introduction'); ?>(最多上传5张图片,每张小于200K.)
<?php
$this->widget('application.extensions.xheditor.JXHEditor', array(
      'model' => $model,
      'attribute' => 'introduction',
      'options' => array(
          'width' => '700',
          'height' => '400',
		  'upImgUrl' =>'?r=product/uploadedFiles&immediate=1',
		  'upImgExt' =>'jpg,jpeg,gif,png',
		  'img_sum' => 5,//最多3张图片
      ),
  ));
?>
</div>
<div class="action">
<?php echo CHtml::submitButton($update ? '更新产品' : '添加产品'); ?>
</div>

<?php echo CHtml::endForm(); ?>

</div><!-- yiiForm -->